#include "stdint.h"
#include "Muti_MB.h"
#include "Muti_MB_mbcrc.h"
/*****************************功能码选择启用***************************************** */
#define MUTI_MB_FUNC_HANDLERS_MAX                    ( 16 )

/*! \brief Number of bytes which should be allocated for the <em>Report Slave ID
 *    </em>command.
 *
 * This number limits the maximum size of the additional segment in the
 * report slave id function. See eMBSetSlaveID(  ) for more information on
 * how to set this value. It is only used if MB_FUNC_OTHER_REP_SLAVEID_ENABLED
 * is set to <code>1</code>.
 */
#define MUTI_MB_FUNC_OTHER_REP_SLAVEID_BUF           ( 32 )

/*! \brief If the <em>Report Slave ID</em> function should be enabled. */
#define MUTI_MB_FUNC_OTHER_REP_SLAVEID_ENABLED       (  0 )

/*! \brief If the <em>Read Input Registers</em> function should be enabled. */
#define MUTI_MB_FUNC_READ_INPUT_ENABLED              (  0 )

/*! \brief If the <em>Read Holding Registers</em> function should be enabled. */
#define MUTI_MB_FUNC_READ_HOLDING_ENABLED            (  1 )

/*! \brief If the <em>Write Single Register</em> function should be enabled. */
#define MUTI_MB_FUNC_WRITE_HOLDING_ENABLED           (  1 )

/*! \brief If the <em>Write Multiple registers</em> function should be enabled. */
#define MUTI_MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED  (  1 )

/*! \brief If the <em>Read Coils</em> function should be enabled. */
#define MUTI_MB_FUNC_READ_COILS_ENABLED              (  1 )

/*! \brief If the <em>Write Coils</em> function should be enabled. */
#define MUTI_MB_FUNC_WRITE_COIL_ENABLED              (  0 )

/*! \brief If the <em>Write Multiple Coils</em> function should be enabled. */
#define MUTI_MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED    (  0 )

/*! \brief If the <em>Read Discrete Inputs</em> function should be enabled. */
#define MUTI_MB_FUNC_READ_DISCRETE_INPUTS_ENABLED    (  1 )

/*! \brief If the <em>Read/Write Multiple Registers</em> function should be enabled. */
#define MUTI_MB_FUNC_READWRITE_HOLDING_ENABLED       (  1 )

/******************************临时 ***************************************** */




/**
 * @brief 功能码 执行函数
 * 
 */

#if MUTI_MB_FUNC_OTHER_REP_SLAVEID_BUF > 0
eMUTI_MB_Exception eMUTI_MB_FuncReportSlaveID(MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_READ_INPUT_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncReadInputRegister(MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_READ_HOLDING_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncReadHoldingRegister( MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_WRITE_HOLDING_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncWriteHoldingRegister( MUTI_MB_object_t *object,UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncWriteMultipleHoldingRegister(MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_READ_COILS_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncReadCoils(MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_WRITE_COIL_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncWriteCoil(MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncWriteMultipleCoils(MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_READ_DISCRETE_INPUTS_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncReadDiscreteInputs(MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif

#if MUTI_MB_FUNC_READWRITE_HOLDING_ENABLED > 0
eMUTI_MB_Exception    eMUTI_MB_FuncReadWriteMultipleHoldingRegister(MUTI_MB_object_t *object, UCHAR * pucFrame, USHORT * usLen );
#endif





















